﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Raise3000.Code
{
    class PlayerTemplateManager : DataManagerInterface
    {
        // members
        List<PlayerTemplate> PlayerTemplateList_;

        public PlayerTemplateManager()
        {
            PlayerTemplateList_  = new List<PlayerTemplate>();
        }

        public void Add(PlayerTemplate pt)
        {
            PlayerTemplateList_.Add(pt);
        }

        public PlayerTemplate FindPlayerTemplateById(long id)
        {
            return PlayerTemplateList_.Find(pt => pt.Id == id); 
        }

        public PlayerTemplate FindPlayerTemplateByName(string name)
        {
            return PlayerTemplateList_.Find(pt => pt.Name == name);
        }

        public List<string> GetPlayerTemplatesNames()
        {
            List<string> playerTemplatesNames = new List<string>();

            foreach (PlayerTemplate pt in PlayerTemplateList_)
            {
                playerTemplatesNames.Add(pt.Name);
            }

            return playerTemplatesNames;
        }
    }
}
